// @ts-ignore
import { FileVo, request} from "../http";

export interface Query {
	
	title: string,
	
	startDate: string,
	
	deadlineDate: string,
	
	addr: string,
	
	pageNum: number | 1,
	
	pageSize: number | 10
	
}


export interface ActiveVo {
	
	id: string,
	
	title: string,
	
	headImg: Array<FileVo>
	
	activeAddr: string,
	
	activeStartTime: string,
	
	activeDeadline:string
}

export interface GuestsWxVo {
	avatar: string;
	name: string;
}

export interface ActiveFormWxVo {
	name: string;
	tableColumnType: string;
	placeholder?: string;
	label: string;
	inputType: string;
	optionValue?: any;
}

export interface ActiveDeWxVo {
	id: number;
	activeTitle: string;
	activeBegin: string;
	activeEnd: string;
	bannerList: FileVo[];
	activeAddr: string;
	activeLabel: string;
	activePrice: number;
	activeOriginPrice: number;
	activeInstance: FileVo[];
	activeTargetGroup: string;
	activeAim: string;
	activeTrip: string;
	guests: GuestsWxVo[];
	activeRegisterDeadline: string;
	activeLimit: number;
	activeRegisteredNum: number;
	activeForm: ActiveFormWxVo[];
}

export interface ActiveForm {
	id: number,
	activeId: number,
	value: string,
	tableId: 0
}


export function getActiveList(data: Query) {
	return request({
		url: "/active/wx/get",
		method: "POST",
		data:data,
		token: null
	})
}

export function getActiveDeVo(data: string) {
	return request({
		url:`/active/wx/${data}`,
		method:"GET",
		token: null,
	})
}

export function registerActive(data: ActiveForm) {
	return request({
		url: "/table_value",
		method:"POST",
		data: data,
		token: null
	})
}